<!-- HTML header for doxygen 1.8.13-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MTB CAT1 Peripheral driver library: Comparator Functions</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen_style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><a href="http://www.cypress.com/"><img alt="Logo" src="IFXCYP_one-line.png"/></a></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">MTB CAT1 Peripheral driver library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('group__group__ctb__functions__comparator.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">Comparator Functions<div class="ingroups"><a class="el" href="group__group__ctb.html">CTB          (Continuous Time Block)</a> &raquo; <a class="el" href="group__group__ctb__functions.html">Functions</a></div></div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">General Description</h2>
<p>This set of functions are specific to the comparator mode. </p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gacb420c428bb8a3f37a48aadd871fa41b"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctb__functions__comparator.html#gacb420c428bb8a3f37a48aadd871fa41b">Cy_CTB_CompSetConfig</a> (<a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *base, <a class="el" href="group__group__ctb__enums.html#ga2175f16ceffc2774b50643be95f32137">cy_en_ctb_opamp_sel_t</a> compNum, <a class="el" href="group__group__ctb__enums.html#ga1d4c88f3c58f2cba9122932a65721f9e">cy_en_ctb_comp_level_t</a> level, <a class="el" href="group__group__ctb__enums.html#gab99b3f65e01d39c47bb49b1255f478d2">cy_en_ctb_comp_bypass_t</a> bypass, <a class="el" href="group__group__ctb__enums.html#gad36a97756b1a5ea884c9a6653c0a26c7">cy_en_ctb_comp_hyst_t</a> hyst)</td></tr>
<tr class="memdesc:gacb420c428bb8a3f37a48aadd871fa41b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configure the CTB comparator for pulse or level output, to bypass clock synchronization, and to enable hysteresis.  <a href="#gacb420c428bb8a3f37a48aadd871fa41b">More...</a><br /></td></tr>
<tr class="separator:gacb420c428bb8a3f37a48aadd871fa41b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga5fc4e36e8d1ea4f51aaaa5f492d15f16"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctb__functions__comparator.html#ga5fc4e36e8d1ea4f51aaaa5f492d15f16">Cy_CTB_CompGetConfig</a> (const <a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *base, <a class="el" href="group__group__ctb__enums.html#ga2175f16ceffc2774b50643be95f32137">cy_en_ctb_opamp_sel_t</a> compNum)</td></tr>
<tr class="memdesc:ga5fc4e36e8d1ea4f51aaaa5f492d15f16"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the CTB comparator operating configuration as set by <a class="el" href="group__group__ctb__functions__comparator.html#gacb420c428bb8a3f37a48aadd871fa41b">Cy_CTB_CompSetConfig</a>.  <a href="#ga5fc4e36e8d1ea4f51aaaa5f492d15f16">More...</a><br /></td></tr>
<tr class="separator:ga5fc4e36e8d1ea4f51aaaa5f492d15f16"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga43c90acd382a820eee4c65d55e1a7989"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctb__functions__comparator.html#ga43c90acd382a820eee4c65d55e1a7989">Cy_CTB_CompSetInterruptEdgeType</a> (<a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *base, <a class="el" href="group__group__ctb__enums.html#ga2175f16ceffc2774b50643be95f32137">cy_en_ctb_opamp_sel_t</a> compNum, <a class="el" href="group__group__ctb__enums.html#ga6ae45a6e79c46d06120295f542981cf4">cy_en_ctb_comp_edge_t</a> edge)</td></tr>
<tr class="memdesc:ga43c90acd382a820eee4c65d55e1a7989"><td class="mdescLeft">&#160;</td><td class="mdescRight">Configure the type of edge that will trigger a comparator interrupt.  <a href="#ga43c90acd382a820eee4c65d55e1a7989">More...</a><br /></td></tr>
<tr class="separator:ga43c90acd382a820eee4c65d55e1a7989"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ga993a0c8735f71bf6f95b9d52a28b5665"><td class="memItemLeft" align="right" valign="top">uint32_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="group__group__ctb__functions__comparator.html#ga993a0c8735f71bf6f95b9d52a28b5665">Cy_CTB_CompGetStatus</a> (const <a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *base, <a class="el" href="group__group__ctb__enums.html#ga2175f16ceffc2774b50643be95f32137">cy_en_ctb_opamp_sel_t</a> compNum)</td></tr>
<tr class="memdesc:ga993a0c8735f71bf6f95b9d52a28b5665"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the comparator output status.  <a href="#ga993a0c8735f71bf6f95b9d52a28b5665">More...</a><br /></td></tr>
<tr class="separator:ga993a0c8735f71bf6f95b9d52a28b5665"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a id="gacb420c428bb8a3f37a48aadd871fa41b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#gacb420c428bb8a3f37a48aadd871fa41b">&#9670;&nbsp;</a></span>Cy_CTB_CompSetConfig()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_CTB_CompSetConfig </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ctb__enums.html#ga2175f16ceffc2774b50643be95f32137">cy_en_ctb_opamp_sel_t</a>&#160;</td>
          <td class="paramname"><em>compNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ctb__enums.html#ga1d4c88f3c58f2cba9122932a65721f9e">cy_en_ctb_comp_level_t</a>&#160;</td>
          <td class="paramname"><em>level</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ctb__enums.html#gab99b3f65e01d39c47bb49b1255f478d2">cy_en_ctb_comp_bypass_t</a>&#160;</td>
          <td class="paramname"><em>bypass</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ctb__enums.html#gad36a97756b1a5ea884c9a6653c0a26c7">cy_en_ctb_comp_hyst_t</a>&#160;</td>
          <td class="paramname"><em>hyst</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Configure the CTB comparator for pulse or level output, to bypass clock synchronization, and to enable hysteresis. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">compNum</td><td><a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a715789db816ed8db3729da6e57aacdcb">CY_CTB_OPAMP_0</a>, <a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a9318dd62afb23fc0c4dac2abcfcea5f0">CY_CTB_OPAMP_1</a>, or <a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a4c859afffdcf6dcf16c4350906759488">CY_CTB_OPAMP_BOTH</a></td></tr>
    <tr><td class="paramname">level</td><td>Configure output to produce a pulse or level output signal</td></tr>
    <tr><td class="paramname">bypass</td><td>Configure output to be clock synchronized or unsynchronized</td></tr>
    <tr><td class="paramname">hyst</td><td>Enable or disable input hysteresis</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: Opamp0 has been configured as a comparator instead of an opamp.</span></div><div class="line"><span class="comment">     * Configure the comparator such the trigger output signal tracks the comparator output,</span></div><div class="line"><span class="comment">     * the comparator output is synchronized for DSI, and hysteresis is enabled. */</span></div><div class="line">    </div><div class="line">    <a class="code" href="group__group__ctb__enums.html#ga1d4c88f3c58f2cba9122932a65721f9e">cy_en_ctb_comp_level_t</a> level    = <a class="code" href="group__group__ctb__enums.html#gga1d4c88f3c58f2cba9122932a65721f9eaa4b8129109df9d5d1ec3d7253baf7fe2">CY_CTB_COMP_DSI_TRIGGER_OUT_LEVEL</a>;</div><div class="line">    <a class="code" href="group__group__ctb__enums.html#gab99b3f65e01d39c47bb49b1255f478d2">cy_en_ctb_comp_bypass_t</a> bypass  = <a class="code" href="group__group__ctb__enums.html#ggab99b3f65e01d39c47bb49b1255f478d2a355e7f8cb9d5ba71b9cd5cfa37e293b5">CY_CTB_COMP_BYPASS_SYNC</a>;</div><div class="line">    <a class="code" href="group__group__ctb__enums.html#gad36a97756b1a5ea884c9a6653c0a26c7">cy_en_ctb_comp_hyst_t</a> hyst      = <a class="code" href="group__group__ctb__enums.html#ggad36a97756b1a5ea884c9a6653c0a26c7a5fcfb393b5ff8d864116f914c5147c06">CY_CTB_COMP_HYST_10MV</a>;</div><div class="line">    </div><div class="line">    <span class="comment">/* Configure the comparator properties. */</span></div><div class="line">    <a class="code" href="group__group__ctb__functions__comparator.html#gacb420c428bb8a3f37a48aadd871fa41b">Cy_CTB_CompSetConfig</a>(CTBM0, <a class="code" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a715789db816ed8db3729da6e57aacdcb">CY_CTB_OPAMP_0</a>, level, bypass, hyst);</div><div class="line">       </div></div><!-- fragment -->
</div>
</div>
<a id="ga5fc4e36e8d1ea4f51aaaa5f492d15f16"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga5fc4e36e8d1ea4f51aaaa5f492d15f16">&#9670;&nbsp;</a></span>Cy_CTB_CompGetConfig()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t Cy_CTB_CompGetConfig </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ctb__enums.html#ga2175f16ceffc2774b50643be95f32137">cy_en_ctb_opamp_sel_t</a>&#160;</td>
          <td class="paramname"><em>compNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return the CTB comparator operating configuration as set by <a class="el" href="group__group__ctb__functions__comparator.html#gacb420c428bb8a3f37a48aadd871fa41b">Cy_CTB_CompSetConfig</a>. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">compNum</td><td><a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a715789db816ed8db3729da6e57aacdcb">CY_CTB_OPAMP_0</a> or <a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a9318dd62afb23fc0c4dac2abcfcea5f0">CY_CTB_OPAMP_1</a></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The comparator configuration. Compare the register value with the masks in <a class="el" href="group__group__ctb__enums.html#ga1d4c88f3c58f2cba9122932a65721f9e">cy_en_ctb_comp_level_t</a>, <a class="el" href="group__group__ctb__enums.html#gab99b3f65e01d39c47bb49b1255f478d2">cy_en_ctb_comp_bypass_t</a>, and <a class="el" href="group__group__ctb__enums.html#gad36a97756b1a5ea884c9a6653c0a26c7">cy_en_ctb_comp_hyst_t</a>.</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: Determine if hysteresis is enabled in Comparator 0. */</span></div><div class="line">    uint32_t compConfig;</div><div class="line">    </div><div class="line">    compConfig = <a class="code" href="group__group__ctb__functions__comparator.html#ga5fc4e36e8d1ea4f51aaaa5f492d15f16">Cy_CTB_CompGetConfig</a>(CTBM0, <a class="code" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a715789db816ed8db3729da6e57aacdcb">CY_CTB_OPAMP_0</a>);</div><div class="line">    </div><div class="line">    <span class="keywordflow">if</span> ((uint32_t) CY_CTB_COMP_HYST_10MV == (compConfig &amp; ((uint32_t) CY_CTB_COMP_HYST_10MV)))</div><div class="line">    {</div><div class="line">        <span class="comment">/* Hysteresis is enabled in Comparator 0. */</span></div><div class="line">    }</div></div><!-- fragment -->
</div>
</div>
<a id="ga43c90acd382a820eee4c65d55e1a7989"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga43c90acd382a820eee4c65d55e1a7989">&#9670;&nbsp;</a></span>Cy_CTB_CompSetInterruptEdgeType()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void Cy_CTB_CompSetInterruptEdgeType </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ctb__enums.html#ga2175f16ceffc2774b50643be95f32137">cy_en_ctb_opamp_sel_t</a>&#160;</td>
          <td class="paramname"><em>compNum</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ctb__enums.html#ga6ae45a6e79c46d06120295f542981cf4">cy_en_ctb_comp_edge_t</a>&#160;</td>
          <td class="paramname"><em>edge</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Configure the type of edge that will trigger a comparator interrupt. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">compNum</td><td><a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a715789db816ed8db3729da6e57aacdcb">CY_CTB_OPAMP_0</a>, <a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a9318dd62afb23fc0c4dac2abcfcea5f0">CY_CTB_OPAMP_1</a>, or <a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a4c859afffdcf6dcf16c4350906759488">CY_CTB_OPAMP_BOTH</a></td></tr>
    <tr><td class="paramname">edge</td><td>Edge type that will trigger an interrupt. Select a value from <a class="el" href="group__group__ctb__enums.html#ga6ae45a6e79c46d06120295f542981cf4">cy_en_ctb_comp_edge_t</a>.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>None</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: Configure both edges (rising and falling) to trigger an interrupt in Comparator 0. */</span></div><div class="line">    </div><div class="line">    <a class="code" href="group__group__ctb__functions__comparator.html#ga43c90acd382a820eee4c65d55e1a7989">Cy_CTB_CompSetInterruptEdgeType</a>(CTBM0, <a class="code" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a715789db816ed8db3729da6e57aacdcb">CY_CTB_OPAMP_0</a>, CY_CTB_COMP_EDGE_BOTH);</div></div><!-- fragment -->
</div>
</div>
<a id="ga993a0c8735f71bf6f95b9d52a28b5665"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ga993a0c8735f71bf6f95b9d52a28b5665">&#9670;&nbsp;</a></span>Cy_CTB_CompGetStatus()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">uint32_t Cy_CTB_CompGetStatus </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="struct_c_t_b_m___type.html">CTBM_Type</a> *&#160;</td>
          <td class="paramname"><em>base</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="group__group__ctb__enums.html#ga2175f16ceffc2774b50643be95f32137">cy_en_ctb_opamp_sel_t</a>&#160;</td>
          <td class="paramname"><em>compNum</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Return the comparator output status. </p>
<p>When the positive input voltage is greater than the negative input voltage, the comparator status is high. Otherwise, the status is low.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">base</td><td>Pointer to structure describing registers</td></tr>
    <tr><td class="paramname">compNum</td><td><a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a715789db816ed8db3729da6e57aacdcb">CY_CTB_OPAMP_0</a> or <a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a9318dd62afb23fc0c4dac2abcfcea5f0">CY_CTB_OPAMP_1</a>. <a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a9e99c0e580cf26beea9ba5a088d20738">CY_CTB_OPAMP_NONE</a> and <a class="el" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a4c859afffdcf6dcf16c4350906759488">CY_CTB_OPAMP_BOTH</a> are invalid options.</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The comparator status. A value of 0 is returned if compNum is invalid.<ul>
<li>0: Status is low</li>
<li>1: Status is high</li>
</ul>
</dd></dl>
<dl class="section user"><dt>Function Usage</dt><dd></dd></dl>
<div class="fragment"><div class="line">    <span class="comment">/* Scenario: Get the comparator output status on Comparator 0 to determine</span></div><div class="line"><span class="comment">     * the if the positive input voltage is greater than or less than the</span></div><div class="line"><span class="comment">     * negative input voltage. */</span></div><div class="line">    uint32_t status;</div><div class="line">    </div><div class="line">    status = <a class="code" href="group__group__ctb__functions__comparator.html#ga993a0c8735f71bf6f95b9d52a28b5665">Cy_CTB_CompGetStatus</a>(CTBM0, <a class="code" href="group__group__ctb__enums.html#gga2175f16ceffc2774b50643be95f32137a715789db816ed8db3729da6e57aacdcb">CY_CTB_OPAMP_0</a>);</div><div class="line">    </div><div class="line">    <span class="keywordflow">if</span> (1UL == status)</div><div class="line">    {</div><div class="line">        <span class="comment">/* Positive input voltage is greater than the negative input voltage. */</span></div><div class="line">    }</div><div class="line">    <span class="keywordflow">else</span></div><div class="line">    {</div><div class="line">        <span class="comment">/* Positive input voltage is less than the negative input voltage. */</span></div><div class="line">    }</div></div><!-- fragment -->
</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part
<div id="nav-path" class="navpath">
    <ul>
        <li class="footer">
            Generated for <b>MTB CAT1 Peripheral driver library</b> by <b>Cypress Semiconductor Corporation</b>.
            All rights reserved.
        </li>
    </ul>
</div>
-->
</body>
</html>
